package site.wlwsjsx.iot_backend.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDateTime;

/**
 * 工位基础信息表
 * 对应表：workstation_info
 */
@Data
@Getter
@Setter
public class WorkstationInfo {
    private Integer id;                 // 主键ID
    private String workstationCode;     // 工位编号
    private Integer belongLabId;        // 所属实验室ID
    private String workstationStatus = "normal"; // 工位状态，默认normal
    private Integer curUserId;          // 使用者ID
    private Integer powerStatus = 0;    // 电源状态，默认0
    private Integer lightStatus = 0;    // 灯光状态，默认0
    private Integer relayNum1Status = 0; // 1号继电器状态，默认0
    private Integer relayNum2Status = 0; // 2号继电器状态，默认0

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime modifyTime;   // 更新时间

    public WorkstationInfo() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getWorkstationCode() {
        return workstationCode;
    }

    public void setWorkstationCode(String workstationCode) {
        this.workstationCode = workstationCode;
    }

    public Integer getBelongLabId() {
        return belongLabId;
    }

    public void setBelongLabId(Integer belongLabId) {
        this.belongLabId = belongLabId;
    }

    public String getWorkstationStatus() {
        return workstationStatus;
    }

    public void setWorkstationStatus(String workstationStatus) {
        this.workstationStatus = workstationStatus;
    }

    public Integer getCurUserId() {
        return curUserId;
    }

    public void setCurUserId(Integer curUserId) {
        this.curUserId = curUserId;
    }

    public Integer getPowerStatus() {
        return powerStatus;
    }

    public void setPowerStatus(Integer powerStatus) {
        this.powerStatus = powerStatus;
    }

    public Integer getLightStatus() {
        return lightStatus;
    }

    public void setLightStatus(Integer lightStatus) {
        this.lightStatus = lightStatus;
    }

    public Integer getRelayNum1Status() {
        return relayNum1Status;
    }

    public void setRelayNum1Status(Integer relayNum1Status) {
        this.relayNum1Status = relayNum1Status;
    }

    public Integer getRelayNum2Status() {
        return relayNum2Status;
    }

    public void setRelayNum2Status(Integer relayNum2Status) {
        this.relayNum2Status = relayNum2Status;
    }

    public LocalDateTime getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(LocalDateTime modifyTime) {
        this.modifyTime = modifyTime;
    }

    @Override
    public String toString() {
        return "WorkstationInfo{" +
                "id=" + id +
                ", workstationCode='" + workstationCode + '\'' +
                ", belongLabId=" + belongLabId +
                ", workstationStatus='" + workstationStatus + '\'' +
                ", curUserId=" + curUserId +
                ", powerStatus=" + powerStatus +
                ", lightStatus=" + lightStatus +
                ", relayNum1Status=" + relayNum1Status +
                ", relayNum2Status=" + relayNum2Status +
                ", modifyTime=" + modifyTime +
                '}';
    }
}

